
@echo off

setlocal EnableDelayedExpansion

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::变量定义

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

@echo param is "%1"

if "%1" EQU "develop" (
    call:update_develop
) ^
else if "%1" EQU "master" (
    call:update_master
) ^
else (
    echo usage:git.bat [master/develop]
)

goto:eof

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:update_master

    @echo git pull
    git pull

    @echo git merge origin/develop
    git merge origin/develop

    @echo git push origin master
    git push origin master
    
goto:eof

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:update_develop

    @echo git pull
    git pull
    
goto:eof

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
